﻿using Newtonsoft.Json;
using System;

namespace ThresholdAssistant.NLogSdk
{
    /// <summary>
    /// 日志输出格式模型
    /// </summary>
    public class NLogModel
    {
        /// <summary>
        /// 请求ID
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string ReqId { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string Type { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string Url { get; set; }

        /// <summary>
        /// 日志打印时间
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string Time { get => DateTime.Now.ToTimeFormat(false); }

        /// <summary>
        /// 服务ID,在配置文件中配置
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string ServerNo { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string Content { get; set; }

        /// <summary>
        /// 请求头部信息
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string Headers { get; set; }

        /// <summary>
        /// 请求参数
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string Request { get; set; }

        /// <summary>
        /// 响应结果
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string Response { get; set; }

        /// <summary>
        /// 程序执行时间（针对API）
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public double? TotalSeconds { get; set; }

        /// <summary>
        /// 操作编号
        /// </summary>
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string SerialNo { get; set; }

        ///// <summary>
        ///// 商家编号
        ///// </summary>
        //[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        //public string MerchantNo { get; set; }

        ///// <summary>
        ///// 机器人编号
        ///// </summary>
        //[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        //public string RobotSerialNo { get; set; }
    }
}